package com.dingding.transfer.stamper.controller;

import com.dingding.transfer.stamper.dto.BaseResult;
import com.dingding.transfer.stamper.dto.FingerAddReq;
import com.dingding.transfer.stamper.service.BusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangxiyuan
 * @description
 * @createDate 2021/3/31 19:22
 **/
@RestController
@RequestMapping("/stamper")
@Api(value = "智能印章管理")
@Slf4j
public class StamperController {
    @Autowired
    private BusinessService businessService;

    /**
     * pushApplication
     * @param uuid     设备Id
     * @param applyId     申请单Id
     * @return 结果
     */
    @PostMapping("/pushApplication")
    @ApiOperation(value = "推送申请单")
    public BaseResult<?> pushApplication(String uuid,String applyId) {
        return businessService.pushRecord(uuid,applyId);
    }

    /**
     * fingerAdd
     * @param data     指纹录入相关参数
     * @return 结果
     */
    @PostMapping("/fingerAdd")
    @ApiOperation(value = "指纹推送指令")
    public BaseResult<?> fingerAdd(FingerAddReq data) {
        return businessService.fingerAdd(data);
    }
}
